<script type="text/javascript" charset="utf-8" src="__PUBLIC__/dest/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/dest/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/dest/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		var ret = 1;
		var old_router_mac = "{$router_info['router_mac']}";
		$.formValidator.initConfig({
			formid:"userForm1",
			onerror:function(msg){
			},
			onsuccess:function(){
				if (old_router_mac != '' && $("#router_mac").val() != old_router_mac && ret == 1){
					showdialog({
						'title':'警告',
						'message':'<font color="red">您修改了路由的MAC,系统将会把源MAC对应的用户转到新的MAC中<br/>并且该路由的在线用户将下线，您确定这么做吗？</font>',
						'okfunction':function(){
							ret = 0;
							$('#userForm1').submit();
						}
					});
					return false;
				}
				
			}
		}); 

		$("#router_mac").formValidator({empty:false,onshow:"请填写要绑定的路由mac",onfocus:"示例：04:8d:38:3a:32:f3",oncorrect:" "})
		.functionValidator({fun:function(val,elem){
			var EMAILS_REGEXP1 = /^([0-9A-Fa-f]{2})(([/\s:][0-9a-fA-F]{2}){5})$/i;
			if (!EMAILS_REGEXP1.test(val)){
				return '路由MAC格式不正确（04:8d:38:3a:32:f3）';
			}
			return true;
		}});
		



	

	});
</script>


<div class="page-content">
	<div class="row">
		<div class="col-xs-12"> 
			<form name="userForm1" id="userForm1" novalidate="" action="{:U('Router/save_router_config')}" method="post"> 
				<div class="form-horizontal">
					
					<div class="form-group">
						<label class="col-sm-2 control-label no-padding-right " for="form-field-1"> 状态：</label>
						<div class="col-sm-9">
							<label>
								{:router_status1($router_info['status'])}
								
							</label>
						</div>
					</div>
		
					
					<div class="form-group" >
						<label class="col-sm-2 control-label no-padding-right margintop5" > 
							路由MAC： 
						</label>
						<div class="col-sm-4">
							<div class="input-group col-xs-10 col-sm-12 ">
								<input type="text" id="router_mac" name="router_mac"  class="form-control" value="{$router_info['router_mac']}"/>
							</div>
							
						</div>
						<div class="help-block col-sm-6" >
							<span id="router_macTip"></span>
						</div>
					</div>
			

					
					
					
					
					<div id="alert_box"></div>
					<div class="clearfix form-actions">
						<div class="col-md-offset-3 col-md-9 col-sm-9">
							<button id="save" class="col-sm-2 btn btn-success" data-loading-text="正在提交,请稍候..." type="submit">
								<i class="icon-save bigger-110"></i>
							 	<span id="submitbutton">保存</span>
							</button>
							
						</div>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>